package atguigu2.completable;

import java.util.concurrent.CompletableFuture;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/4
 * @VERSION 1.0
 * @DESC
 */
public class CompleteFutureDemo {
    public static void main(String[] args) {
        CompletableFuture<Integer> completableFuture =CompletableFuture.supplyAsync(()->{
            System.out.println("执行...");
            return 1;
        });
        completableFuture.whenComplete((v,e)->{
            System.out.println("值为"+v+";异常:"+e);
        });

    }
}
